package com.kevin.ms.controller;

import com.kevin.ms.redis.KeyPrefix;
import com.kevin.ms.redis.RedisService;
import com.kevin.ms.redis.UserKey;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    private RedisService redisService;


    @RequestMapping("test")
    public String test() {
        redisService.set(UserKey.getById, "name", "lkw");
        return "test";
    }

    @RequestMapping("query")
    public String query() {
        return redisService.get(UserKey.getById, "name", String.class);
    }
}
